package com.agger.harmonyosthemeseditor.intelligent;

import com.agger.harmonyosthemeseditor.ResourceTable;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.TextField;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.components.element.VectorElement;
import ohos.agp.utils.Color;
import ohos.app.Context;

public class TextBoxManager
{
    public static ShapeElement getTextCursor()
    {
        ShapeElement shapeElement = new ShapeElement();
        shapeElement.setRgbColor(RgbColor.fromArgbInt(Color.RED.getValue()));
        return shapeElement;
    }

    public static VectorElement getCursorBubble(Context mContext)
    {
        return new VectorElement(mContext,ResourceTable.Graphic_cursor_bubble);
    }

    public static void TextBoxForStyle(Context mContext,TextField textField)
    {
        textField.setCursorElement(getTextCursor());
        textField.setBubbleElement(getCursorBubble(mContext));
        textField.setSelectionLeftBubbleElement(getCursorBubble(mContext));
        textField.setSelectionRightBubbleElement(getCursorBubble(mContext));
    }
}
